package com.xjm.i1.constant;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public enum AreaEnum {
    UPLEFT("左上"), DOWNLEFT("左下"), UPRIGHT("右上"), DOWNRIGHT("右下"), MIDDLE("中间"), CONTRAST("阶调");

    private String val;

    AreaEnum(String val) {
        this.val = val;
    }

    public static List<String> getVals() {
        AreaEnum[] values = AreaEnum.values();
        ArrayList<String> res = new ArrayList<>(values.length);
        for (AreaEnum en : values) {
            res.add(en.val);
        };
        return res;
    }

    public static AreaEnum checkAreaType(String fileName) {
        for (AreaEnum valEnum: AreaEnum.values()) {
            if (valEnum.getVal().equals(fileName)) {
                return valEnum;
            }
        }
        return null;
    }
}